﻿<table cellspacing="0" cellpadding="0" class="cssgrid">
    <tbody>
        <tr class="category">
            <td width="30px" align="center" style="border-top: 1px solid #99BBE8;" class="headercart productcategory">
                <span class="norB">STT</span>
            </td>
            <td width="120px" align="center" style="border-top: 1px solid #99BBE8;" class="headercart">
                <span class="norB">Tên Role</span>
            </td>
            <td width="80px" align="center" style="border-top: 1px solid #99BBE8;" class="headercart">
                <span class="norB">Trạng thái</span>
            </td>
            <td width="80px" align="center" style="border-top: 1px solid #99BBE8;" class="headercart">
                <span class="norB">Phân quyền</span>
            </td>
            <td width="60px" align="center" style="border-top: 1px solid #99BBE8;" class="headercart">
            </td>
        </tr>
        {#foreach $T.Items as role}
        <tr>
            <td width="20px" align="center" class="headercart productcategory" id="divItem">
                <span id="divSTT"></span>
            </td>
            <td width="100px" align="center" class="headercart">
                <span>{$T.role.Name}</span>
            </td>
            <td width="80px" align="center" class="headercart">
                <span>{#if $T.role.Status==1}
                Đang kích hoạt
                {#else}
                Đã khóa
                {#/if}</span>
            </td>
            <td width="260px" align="center" class="headercart" id="per{$T.role.Id}">
                {#if (($T.role.Permission & 8) == 8) }
                <input type="checkbox" id="cbxPermissionView{$T.role.FunctionID}" checked="checked"/><span>Xem</span>
                {#else}
                <input type="checkbox" id="cbxPermissionView{$T.role.FunctionID}" /><span>Xem</span>
                {#/if}

                {#if (($T.role.Permission & 4) == 4) }
                <input type="checkbox" id="cbxPermissionAdd{$T.role.FunctionID}" checked="checked" /><span>Thêm</span>
                {#else}
                <input type="checkbox" id="cbxPermissionAdd{$T.role.FunctionID}" /><span>Thêm</span>
                {#/if}

                {#if (($T.role.Permission & 2) == 2) }
                <input type="checkbox" id="cbxPermissionEdit{$T.role.FunctionID}" checked="checked" /><span>Sửa</span>
                {#else}
                <input type="checkbox" id="cbxPermissionEdit{$T.role.FunctionID}" /><span>Sửa</span>
                {#/if}

                {#if (($T.role.Permission & 1) == 1) }
                <input type="checkbox" id="cbxPermissionDelete{$T.role.FunctionID}" checked="checked"/><span>Xóa</span>
                {#else}
                <input type="checkbox" id="cbxPermissionDelete{$T.role.FunctionID}" /><span>Xóa</span>
                {#/if}
                <a style="font-style: italic;color:Green" id="aUpdatePermission" href="javascript:;"> - Cập nhật</a>
            </td>
            <td width="60px" align="center" class="headercart">
                <div id="delete{$T.role.Id}" class="select_function" style="width:40px"><a href="javascript:;" id="aDeleteRoleFunction" >Xóa</a></div>
            </td>
        </tr>
        {#/for}
    </tbody>
</table>
